


function BuildChartForYearByDP(year) {

    $.ajax({
        url: adminContent+"/adminScreen.do?action=BaseNonworkAction&event_submit_do_query_year_date=method",
        data:
            {
                year: year
            },
        type: "post",
        success: function (obj) {

            var str = "";
            for (var i = 0; i < obj.length; i++) {
                str += obj[i] + ",";
            }

            str = str.substring(0, str.length - 1);

            $("#yearStr").html(str);


            var p = $("#yearStr").html();
            var strs = p.split(',');

            $("#J_datePicker").html("");

            $("#J_datePicker").attr("kitdp", strs);

            BuildRL(strs, year);

        },
        error: function (jqXHR, textStatus, errorThrown) {

        }
    });

}



function BuildRL(strs, year) {

    var kitdate = [];

    for (var i = 0; i < strs.length; i++) {
        kitdate.push($kit.date.parseDate(strs[i], $kit.date.parseFormat('yyyy-MM-dd'), 'cn'));
    }

    var myDate = new Date(year, 0, 1);

    window.picker = new $kit.ui.DatePicker.NMonths({ dateFormat: 'yyyy-mm-dd', date: kitdate }, myDate);
    picker.init();

    $kit.el('#J_datePicker').appendChild(picker.picker);

    picker.show();
    picker.ev({
        ev: 'change',
        fn: function (e) {

            var d = this.date.pattern("yyyy-MM-dd");

            $.ajax({
                url: adminContent+"/adminScreen.do?action=BaseNonworkAction&event_submit_do_insert=method",
                data:
            {
                kitdp: d
            },
                type: "post",
                success: function (obj) {

                    BuildChartForYearByDP(year);
                },
                error: function (jqXHR, textStatus, errorThrown) {

                }
            });


        }
    });

}










